<html>
<head>
    <script src="js/jquery-3.2.1.min.js"></script>
</head>
<body>
<h2>Hello World!</h2>

<script type="text/javascript">
    function fetchCaptcha() {
        $.ajax({
            url: "http://localhost:8080/api/v1/user_auths/fetchCaptcha",
            type: "get",
            data: {
                tel: 18159801285
            },
            success: function (result) {
                console.log(result);
            }
        })
    }

    function login() {
        $.ajax({
            url: "http://localhost:8080/api/v1/user_auths/login",
            type: "post",
            data: {
                username: "18159801285",
                password: "123123"
            },
            success: function (result) {
                console.log(result);
            }
        })
    }


    function register() {
        $.ajax({
            url: "http://localhost:8080/api/v1/user_auths/fetchCaptcha",
            type: "get",
            data: {
                tel: 18159801285
            },
            success: function (result) {
                console.log(result);
            }
        })
    }
</script>

<button id="b02" type="button" onclick="fetchCaptcha()">获取校验码</button>
<button id="b03" type="button" onclick="login()">登录</button>
</body>
</html>
